
@SET_MAKE@
# These are all provided by autoconf, but not necessarily used.
PACKAGE_TARNAME = @PACKAGE_TARNAME@
srcdir = @srcdir@
bindir = @bindir@
datadir = @datadir@/${PACKAGE_TARNAME}
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@/man1
pdfdir = @pdfdir@
prefix = @prefix@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@/${PACKAGE_TARNAME}

INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@

QMAKE = @QMAKEBIN@
DOXYGEN = @doxygen@
BINTRG = @bintrg@
INSTALL_BINTRG = $(BINTRG:%=bin/%)
UNINSTALL_BINTRG = $(BINTRG:%=$(bindir)/%)
OTHRTRG = @othrtrg@
DATATRG = @datatrg@
INSTALL_DATATRG = $(DATATRG:%=config_files/%)
MANTRG = @mantrg@
INSTALL_MANTRG = $(MANTRG)
UNINSTALL_MANTRG := $(mandir)/$(notdir $(MANTRG))
TRG = $(INSTALL_BINTRG) $(OTHRTRG)

INSTALL_XSCR = idlescreen-glx.conf
xscrdatadir = /usr/share/xscreensaver/hacks.conf.d/
UNINSTALL_XSCR = $(xscrdatadir)/$(INSTALL_XSCR)
UPDATEXSCR = @UPDATEXSCR@

.PHONY : forceall all clean doc repoclean distclean

forceall :
	-rm bin/*
	$(MAKE) all

all : $(TRG)

bin/PlasmaLenz : src/PlasmaLenz/project_files/PlasmaLenz_scr.pro
	cd $(srcdir)/src/PlasmaLenz/project_files/ && $(QMAKE) PlasmaLenz_scr.pro \
	-o Makefile.PlasmaLenz_scr && \
	$(MAKE) -f Makefile.PlasmaLenz_scr

bin/PlasmaLenz_glut : src/PlasmaLenz/project_files/PlasmaLenz_glut.pro
	cd $(srcdir)/src/PlasmaLenz/project_files/ && $(QMAKE) PlasmaLenz_glut.pro \
	-o Makefile.PlasmaLenz_glut && \
	$(MAKE) -f Makefile.PlasmaLenz_glut

bin/Crawlies : src/Crawlies/project_files/Crawlies_scr.pro
	cd $(srcdir)/src/Crawlies/project_files/ && $(QMAKE) Crawlies_scr.pro \
	-o Makefile.Crawlies_scr && \
	$(MAKE) -f Makefile.Crawlies_scr

bin/Crawlies_glut : src/Crawlies/project_files/Crawlies_glut.pro
	cd $(srcdir)/src/Crawlies/project_files/ && $(QMAKE) Crawlies_glut.pro \
	-o Makefile.Crawlies_glut && \
	$(MAKE) -f Makefile.Crawlies_glut

bin/AcidRain : src/AcidRain/project_files/AcidRain_scr.pro
	cd $(srcdir)/src/AcidRain/project_files/ && $(QMAKE) AcidRain_scr.pro \
	-o Makefile.AcidRain_scr && \
	$(MAKE) -f Makefile.AcidRain_scr

bin/AcidRain_glut : src/AcidRain/project_files/AcidRain_glut.pro
	cd $(srcdir)/src/AcidRain/project_files/ && $(QMAKE) AcidRain_glut.pro \
	-o Makefile.AcidRain_glut && \
	$(MAKE) -f Makefile.AcidRain_glut

bin/PlasmaGenerator : src/PlasmaGenerator/project_files/PlasmaGenerator.pro
	cd $(srcdir)/src/PlasmaGenerator/project_files/ && $(QMAKE) PlasmaGenerator.pro \
	-o Makefile.PlasmaGenerator && \
	$(MAKE) -f Makefile.PlasmaGenerator

doc : 
	cd doc; $(MAKE)

clean :
	-rm *~
	-rm bin/PlasmaLenz bin/PlasmaLenz_glut
	-rm bin/Crawlies bin/Crawlies_glut
	-rm bin/AcidRain bin/AcidRain_glut
	-rm bin/PlasmaGenerator
	-cd $(srcdir)/src/PlasmaLenz/project_files/ && $(MAKE) -f Makefile.PlasmaLenz_scr clean
	-cd $(srcdir)/src/PlasmaLenz/project_files/ && $(MAKE) -f Makefile.PlasmaLenz_glut clean
	-cd $(srcdir)/src/Crawlies/project_files/ && $(MAKE) -f Makefile.Crawlies_scr clean
	-cd $(srcdir)/src/Crawlies/project_files/ && $(MAKE) -f Makefile.Crawlies_glut clean
	-cd $(srcdir)/src/AcidRain/project_files/ && $(MAKE) -f Makefile.AcidRain_scr clean
	-cd $(srcdir)/src/AcidRain/project_files/ && $(MAKE) -f Makefile.AcidRain_glut clean
	-cd $(srcdir)/src/PlasmaGenerator/project_files/ && $(MAKE) -f Makefile.PlasmaGenerator clean
	-cd doc; $(MAKE) -f Makefile clean

distclean:
	-rm *~
	-rm bin/PlasmaLenz bin/PlasmaLenz_glut
	-rm bin/Crawlies bin/Crawlies_glut
	-rm bin/AcidRain bin/AcidRain_glut
	-cd $(srcdir)/src/PlasmaLenz/project_files/ && $(MAKE) -f Makefile.PlasmaLenz_scr distclean
	-cd $(srcdir)/src/PlasmaLenz/project_files/ && $(MAKE) -f Makefile.PlasmaLenz_glut distclean
	-cd $(srcdir)/src/Crawlies/project_files/ && $(MAKE) -f Makefile.Crawlies_scr distclean
	-cd $(srcdir)/src/Crawlies/project_files/ && $(MAKE) -f Makefile.Crawlies_glut distclean
	-cd $(srcdir)/src/AcidRain/project_files/ && $(MAKE) -f Makefile.AcidRain_scr distclean
	-cd $(srcdir)/src/AcidRain/project_files/ && $(MAKE) -f Makefile.AcidRain_glut distclean
	-cd $(srcdir)/src/PlasmaGenerator/project_files/ && $(MAKE) -f Makefile.PlasmaGenerator distclean
	-cd doc; $(MAKE) -f Makefile distclean
	-rm -rf autom4te.cache
	-rm Makefile

repoclean: distclean
	-rm configure config.status config.log

install : 
	mkdir -p $(bindir) $(datadir) $(sysconfdir) $(mandir)
	$(INSTALL_PROGRAM) $(INSTALL_BINTRG) $(bindir)
	$(INSTALL_DATA) $(INSTALL_DATATRG) $(datadir)
	$(INSTALL_DATA) $(INSTALL_DATATRG) $(sysconfdir)
	$(INSTALL_DATA) $(INSTALL_MANTRG) $(mandir)
	-$(INSTALL_DATA) $(INSTALL_XSCR) $(xscrdatadir)
	-cd doc; $(MAKE) -f Makefile install
	-$(UPDATEXSCR)

uninstall :
	-cd doc; $(MAKE) -f Makefile uninstall
	-rm -f $(UNINSTALL_BINTRG) $(UNINSTALL_MANTRG) $(UNINSTALL_XSCR)
	-rm -rf $(datadir) $(sysconfdir)
	-$(UPDATEXSCR)
